package com.xjh.basestudy.designmode.behaviorMode.behaviorMode3_ChainOfResponsibility.p2_chain;

/**
 * @Author XuJianHua
 * @Date 2022/10/4 14:39
 * @Description

 */
public class Manager extends Approver {

    public Manager(String name) {
        super(name);
    }

    @Override
    public void approve(int amount) {
        if (amount <= 5000) {
            System.out.println("审批通过。【经理：" + name + "】");
        } else {
            System.out.println("无权审批，升级处理。【经理：" + name + "】");
            this.nextApprover.approve(amount);
        }
    }

}